home *** CD-ROM | disk | FTP | other *** search
- extern pascal void CenterWindow ();
- extern pascal void GetCenterPoint ();
- extern pascal void MoveBWindow ();
- extern pascal char ShortFName ();
- extern pascal char TrackRect ();
-
- extern pascal char OKCancel ();
- extern pascal void OKAlert ();
- extern pascal short YesNoCancel ();
- extern pascal int SelectFile ();
-
- extern pascal Handle SuperNewHandle ();
- extern pascal void SuperHLock ();
- extern pascal void SuperHUnLock ();
- extern pascal void SuperDisposHandle ();
-
- /*---------------------- Documentation of ResX Utils.h -------------------*/
- /*
- ResX Toolbox
- ResX Utils is a library to be used for ResX externals and views.
- It can only be used with ResX and any attempt to use it with another
- project may be very hazardous to your health because it relies on the
- presents of ResX to work.
-
- PROCEDURE CenterWindow (theWindow: WindowPtr);
- PROCEDURE GetCenterPoint (var thePoint: Point);
- PROCEDURE MoveBWindow (theWindow: WindowPtr; PrevWindowRect: Rect; var windFlag: Boolean);
-
- FUNCTION ShortFName (LongName: Str255): Str255;
-
- PROCEDURE GetDirInfo (vRefNum: Integer; vName: StringPtr; var wdDirID: Longint);
- FUNCTION TrackRect (theRect: Rect): Boolean;
-
-
-
- Internal Alerts -
- The following Alerts allow direct access to the Alerts internal to ResX. When a
- message or question is passed in, the Alert resources inside of ResX are used.
- This simplifies writing externals for ResX by leaps and bounds since the
- developer does not need to program for these common PROCEDUREs.
-
- FUNCTION OKCancel (Message: Str255): boolean; TRUE if OK is clicked, FALSE if Cancel is clicked
- PROCEDURE OKAlert (Message: Str255);
- FUNCTION YesNoCancel (Question: Str255): integer; Yes=1, No=0, Cancel=-1
-
-
-
-
- FUNCTION SelectFile: integer;
- SelectFile -
- This FUNCTION checks to see if a file is opened within ResX. If only one file is opened,
- it's fileID will be returned. If two files are opened, a dialog will appear and ask to select
- file. The fileID of the file selected will be returned. If the user cancels from the dialog,
- a zero will be returned. If no files are opened, a -1 will be returned.
-
- The resource to the dialog exists inside of ResX.
-
- Result Codes:
- -1: No file open.
- 0: Cancel was selected.
- >0: fileID of the file selected.
-
-
- FUNCTION TrapAvailable (theTrap: Integer): Boolean;
- TrapAvailable -
- Determines if a toolbox trap is available. theTrap is the trap address to test.
- Example:
- if TrapAvailable(_OSDispatch) then .....
-
-
-
- Super Memory Manager
-
- The Super Memory Manager is the best of the standard memory routines and the
- Temporary memory routines. It tests to see if the Temporary Memory Routines
- exists and uses it if there is more memory available in the free space than in the
- current heap. If the blockSize requested is not available, it returns 90% of the
- maximum available memory that can be obtained from either the current heap or
- the free space heap, whichever is greater.
-
- HType is used by the Super Memory Manager to determine what type of handle was
- created. HType must NOT be altered at any time. It is necessary to dispose of a
- SuperHandle properly.
-
-
-
- FUNCTION SuperNewHandle (blockSize: Size; var HType: Boolean; var resultCode: OSErr): Handle;
- SuperNewHandle -
- blockSize - requested amount of memory to create a handle for. If the requested amount
- is not available, 90% of the available memory is returned.
- HType - returns the type of handle that was created. True if Temporary, False if Standard.
- Do not alter HType! Alway use it to pass into Lock,Unlock and Dispose PROCEDUREs.
- resultCode- the standard MemError result.
- RETURNS - a standard Handle.
-
- If blockSize requested is not available, 90% of the maximum available memory is used.
- Use SizeOf(myHandle) to determine the size of the handle if needed.
-
-
-
- PROCEDURE SuperHLock (theHandle: Handle; HType: Boolean; var resultCode: OSErr);
- SuperHLock -
- theHandle - the Super handle to lock
- HType - the type of handle provided by SuperNewHandle.
- resultCode- the standard MemError result.
-
-
- PROCEDURE SuperHUnLock (theHandle: Handle; HType: Boolean; var resultCode: OSErr);
- SuperHUnLock -
- theHandle - the Super handle to UNlock
- HType - the type of handle provided by SuperNewHandle.
- resultCode- the standard MemError result.
-
-
- PROCEDURE SuperDisposHandle (theHandle: Handle; HType: Boolean; var resultCode: OSErr);
- SuperDisposHandle -
- theHandle - the Super handle to Dispose of.
- HType - the type of handle provided by SuperNewHandle.
- resultCode- the standard MemError result.
-
- */
-
-